#!/bin/sh

# GTA IV initialization script

# GAME variables

export DXVK_HUD=fps,memory,version
export WINEDLLOVERRIDES=d3d9

export WINEPREFIX="$HOME/Wine/Games/GTA-IV" &&
export GAMEPATH="$HOME/Wine/Games/GTA-IV/Grand Theft Auto IV/GTAIV" &&
export GAMEEXE="LaunchGTAIV.exe" &&

# WINE variables
export WINEDEBUG="-all" &&

# Execute game

cd "$GAMEPATH" &&

screen=$(echo 'Windowed''\n''Fullscreen' | /usr/bin/dmenu -p 'Screen mode:' -i -fn "xos4 Terminus:size=10" -nb '#282828' -nf '#ebdbb2' -sb '#458588' -sf '#282828')

if [ -z "$screen" ]; then
exit
elif [ $screen = Windowed ]; then
wine-staging explorer /desktop=GTA-IV,1024x768 "$GAMEPATH"/"$GAMEEXE"
else
wine-staging "$GAMEPATH"/"$GAMEEXE"
fi


